window.BROWSER_VERSION = null;

window.onload=function(){
	
	if(!window.BROWSER_VERSION) {
		window.BROWSER_VERSION = browser();
	}
	var _h;
	if(window.BROWSER_VERSION.ie) {
		_h = document.body.scrollHeight;
	} else if(window.BROWSER_VERSION.firefox) {
		_h = document.body.scrollHeight;
	} else if(window.BROWSER_VERSION.chrome) {
		_h = document.documentElement.scrollHeight;
	} else {
		_h = document.body.scrollHeight;
	}
	var _p = parent;
		frameElement.height = _h;
	 while (true) {
		 if(!_p.frameElement) {
			 break;
		 }
		 var _ph;
		 if(window.BROWSER_VERSION.ie) {
			 _ph = _p.document.body.scrollHeight;
		 } else if(window.BROWSER_VERSION.firefox) {
			 _ph = _p.document.body.scrollHeight;
		 } else if(window.BROWSER_VERSION.chrome) {
			 _ph = _p.document.documentElement.scrollHeight;
		 } else {
			 _ph = _p.document.body.scrollHeight;
		 }
			 _p.frameElement.height = _ph;
		 _p = _p.parent;
	}
}

function browser() {
	var Sys = {};
	var ua = navigator.userAgent.toLowerCase();
	if(ua) {
		ua = navigator.appVersion.toLowerCase();
	}
	var s;
	(s = ua.match(/msie ([\d.]+)/)) ? Sys.ie = s[1] :
	(s = ua.match(/firefox\/([\d.]+)/)) ? Sys.firefox = s[1] :
	(s = ua.match(/chrome\/([\d.]+)/)) ? Sys.chrome = s[1] :
	(s = ua.match(/opera.([\d.]+)/)) ? Sys.opera = s[1] :
	(s = ua.match(/version\/([\d.]+).*safari/)) ? Sys.safari = s[1] : 0;
	return Sys;
}